#ifndef __COM_TITLE_H__
#define __COM_TITLE_H__

#include "sys_port.h"

#define ICON_INTERVAL   14  //顶部定位小图标间隔
#define TITLE_SHOW_ALL      0
#define TITLE_SHOW_LEFT     1
#define TITLE_HIDE_ALL      2
#define TITLE_MAX_POINT     (10)

typedef struct  {
	lv_obj_t * title_left_info;         //左边标题信息
    lv_timer_t * title_name_timer;      //标题刷新定时器

    lv_obj_t * top_icon;                //顶部居中存放小图标用
    lv_obj_t * top_icon_point;          //场景页小圆点图标
    lv_obj_t * top_icon_home;           //主页小图标
    lv_obj_t * top_icon_point_dev[TITLE_MAX_POINT];  //设备页小圆点图标，最大设备数为10，看情况调整
    int page_id;                        //页面id，从root_ctl_t.id获取
    lv_timer_t * title_point_timer;      //小圆点刷新定时器

    lv_obj_t * title_right_temp;        //右侧温度
    lv_obj_t * wifi_icon;               //wifi图标
    lv_obj_t * title_hour;              //时间信息
    lv_obj_t * title_min;               //分钟信息
    lv_obj_t * title_right_colon;       //冒号
    lv_timer_t * local_timer;           //冒号闪烁定时器

    uint8_t title_state;                //标题栏是否隐藏

}top_title_t;

extern char * title_point[2];

void title_left(void);
void timer_title_name(lv_timer_t * timer);
void title_middle(void);
void point_timer(lv_timer_t * timer);
void title_right(void);
void timer_right(lv_timer_t * timer);

int com_title_create(void);
int com_title_hide_all(void);
int com_title_show_all(void);
int com_title_show_left(void);

void set_title_page_id(int id);
int  get_title_page_id(void);

#endif
